The NCBI required a fast way of calculating the gamma function that could be used in public domain software. The precision approximation developed corrects Stirling's approximation with contributions from the first few poles of the gamma function in the left complex plane. Sequence analysis naturally gives rise to combinatorial problems. The gamma (or factorial) function is heavily used to compute answers to these problems. Since the factorial function, n!, equals 1x2x...xn, straightforward calculation of n! for large n can be quite slow. The precision approximation reduces the calculation to 2 exponentiations and about 30 additions, multiplications, or divisions, regardless of the size of n. The approximation can also calculate n! for fractional n, which is necessary in other applied mathematical applications. The digamma and trigamma functions are the logarithmic derivatives of the gamma function, and arise in Bayesian estimates of the information in an alignment of protein or DNA sequences. The precision approximation for the gamma can be manipulated to provide approximations for the digamma and trigamma functions.